# coding = utf-8

# 服务器短

import socket
server = socket.socket()
server.bind(('localhost', 6969))    # 绑定要监听的端口
server.listen()     # 监听

print("我要开始等电话了")
conn, addr = server.accept()     # 等电话打进来
# conn 就是客户端连过来而在服务器端为其生成的实例
print(conn)
print(""" ********* """)
print(addr)

print("开始接电话了")

data = conn.recv(1024)
print("recv:", data)
conn.send(data.upper())

server.close()






